
function myInstanceof(left,right){
    let proto = Object.getPrototypeOf(left); //获取想要验证对象的原型对象
    let rightproto = right.prototype; //得到构造函数的原型对象
    //判断构造函数的原型对象是否在对象的原型链上
    while(1){
        if(!proto) return false; 
        if(proto === rightproto) return true;
        proto = Object.getPrototypeOf(proto);
    }
}